package com.shipin.shangchuan.Lambda;

public class Demo05Calculator {
    public static void main(String[] args) {
        invokeCal(10, 20, new Calculator() {

            @Override
            public int calc(int a, int b) {
                return a + b;
            }
        });

        invokeCal(1000, 2000, (a,b) ->
             a+b
        );
    }


    public static int invokeCal(int a, int b, Calculator calculator) {
        int sum = calculator.calc(a,b);
        System.out.println(sum);
        return sum;
    }
}
